<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<body>
<form class="layui-form layui-form-pane" id="operatePage">
    <div class="page-title">
        <div class="page-title-con">
            <span>添加体验注册信息</span>
            <div class="move_title"></div>
            <?php include "../public/sub.php";?>
        </div>
    </div>

    <div class="main-container">
        <div class="layui-form-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label"><text>*</text>姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="realname" id="realname" placeholder="请输入" clearable autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label"><text>*</text>登录手机号</label>
                    <div class="layui-input-block">
                        <input type="text" name="tel" id="tel" placeholder="请输入" maxlength="11" clearable autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label">登录密码</label>
                    <div class="layui-input-block">
                        <input type="text" name="pass" id="pass" placeholder="请输入，留空则以手机号作为初始密码" clearable autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label">公司名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="reg_com" id="reg_com" placeholder="请输入" clearable autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label">部门</label>
                    <div class="layui-input-block">
                        <input type="text" name="reg_dept" id="reg_dept" placeholder="请输入" clearable autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label">来源</label>
                    <div class="layui-input-block">
                        <div class="radio-block">
                            <input type="radio" name="reg_vision" lay-filter="reg_vision" checked value="" title="空">
                            <input type="radio" name="reg_vision" lay-filter="reg_vision" value="wisecert" title="wisecert">
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <div class="layui-form-item height_auto">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label label_textarea">备注</label>
                    <div class="layui-input-block">
                        <textarea id="explain" name="explain" placeholder="请输入" class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>
<script>


    $("#operatePage").validate({
        rules: {
            realname: {required: true},
            tel: {required: true},
        },
        messages:{
            realname: {required: "请输入"},
            tel: {required: "请输入"},
        }
    });

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;

        facade.ajax({type: 'get', url: ask_userreg_add}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;


                render_from();
            }
        });

        form.on('submit(add)', function(data){
            var validRes = $("#operatePage").valid();
            if(!validRes){return false;}


            facade.ajax({url: ask_userreg_add, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    dataPostTimeOut();
                }
            });

            return false;
        });

    });

</script>
</body>
</html>
